package com.sport.controller;

import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.sport.entity.Productlabeling;
import com.sport.entity.ProductTag;
import com.sport.model.Result;
import com.sport.service.ProductService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;


@RestController
@Tag(name = "商品标签")
@RequestMapping("/product")
@ApiSupport(author = "开心摆烂", order = 8)
public class ProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/tags")
    public Result<List<ProductTag>> getProductTags(@RequestParam String productName) {
        return Result.success(productService.getProductTagsByProductName(productName));
    }




    @GetMapping("/details")
    public Result<Productlabeling> getProductDetails(@RequestParam String productName) {
        return Result.success(productService.getProductLabelingByName(productName));
    }
}

